<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <script>
    // Date是一个内置类
    console.log(Date.prototype)

    //const d = new Date()
    //console.log(d)

    const d = new Date("2020-12-1 12:10:35")
    console.log(d)
    //
    console.log(d.getFullYear())
    console.log(d.getMonth())  // 从0开始的要+1
    console.log(d.getDate())
    //
    //console.log(d.getHours())
    //console.log(d.getMinutes())
    //console.log(d.getSeconds())
    //
    console.log(d.getTime())   // Unix时间戳 从1970-1-1




  </script>
</body>
</html>
